home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / printe1a / clsprint.txt < prev    next >
Text File  |  1997-10-20  |  2KB  |  45 lines

  1. '
  2. ' =======================================================================
  3. '
  4. ' CLASS   : clsPrintDialog
  5. ' PURPOSE : Show a dialog to select a printer and to set printer
  6. '           properties. Selected printer will be set to Printer object
  7. '           WITHOUT CHANGING DEFAULT PRINTER.
  8. '           Printer object could print to selected printer then.
  9. '           This class work like "MS Common Dialogs" ShowPrinter method,
  10. '           but it set Printer object without changing default printer.
  11. ' HELP    : Look "MS Common Dialogs" OCX help, it applies also to this
  12. '           class. All Flags constants are supported.
  13. ' NOTE    : Do you have found any bug or improvement ?
  14. '           Please let me know, that's why I'm sharing source code.
  15. ' AUTHOR  : ___________________________________________________
  16. '            Luca Minudel                    software designer
  17. '            Italy Conegliano(TV)
  18. '            voice & fax                     +39 (0)438 412280
  19. '            e-mail                      luca.minudel@nline.it
  20. '            WWW                       (italian language used)
  21. '            http://www.geocities.com/SiliconValley/Vista/4041
  22. '
  23. ' =======================================================================
  24. '
  25.  
  26. Try the class with this code :
  27.  
  28. Dim P As New clsPrintDialog
  29.   P.Flags = cdlPDPageNums + cdlPDDisablePrintToFile + cdlPDNoSelection
  30.   P.Min = 1
  31.   P.FromPage = 3
  32.   P.ToPage = 5
  33.   P.Max = 100
  34.   P.ShowPrinter
  35.   Debug.Print Printer.DeviceName
  36.   Debug.Print Printer.Copies
  37.   Debug.Print P.FromPage
  38.   Debug.Print P.ToPage
  39.   ' Write here Print Code with Printer Object...
  40.  
  41.  
  42. P.S. VB4 doesn't support public costant declaration in class module.
  43.      To use this code with VB4 remove Enum declarations and put
  44.      costant declarations in a .BAS module.
  45.